#pragma once
#include <QTcpSocket>
#include <QByteArray>
#include "ZPackageHead.h"

class ZTcpSocketIOHelper
{
public:
	static bool ReadData(QTcpSocket& tcpSocket, ZPackageHead& packageHead, QByteArray& packageBody, int iOutTime);
	static bool WriteData(QTcpSocket& tcpSocket, ZPackageHead& packageHead, QByteArray& packageBody, int iOutTime = 3000, 
		int* pTotalSize = NULL, int* pWriteSize = NULL);

	static bool WriteDataS(QTcpSocket& tcpSocket, ZPackageHead& packageHead, const QString& packageBody, int iOutTime = 3000, 
		int* pTotalSize = NULL, int* pWriteSize = NULL);
};

